package com.javaee.ejb.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the conversation database table.
 * 
 */
@Entity
@Table(name="conversation")
@NamedQueries(
{
	@NamedQuery(name = "FindConversation", query = "SELECT OBJECT (c) FROM Conversation c where c.caller_idemployee = :p_callerid and c.called_idemployee = :p_calledid"),
	//@NamedQuery(name = "FindConversation", query = "SELECT OBJECT (cv) FROM Conversation cv "),
   
})
public class Conversation implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int idconversation;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="day_time_begin")
	private Date dayTimeBegin;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="day_time_end")
	private Date dayTimeEnd;

//	//bi-directional many-to-one association to Employee
//    @ManyToOne
//	@JoinColumn(name="caller_idemployee")
//	private Employee employee1;
    
    private int caller_idemployee;
    private int called_idemployee;

//	//bi-directional many-to-one association to Employee
//    @ManyToOne
//	@JoinColumn(name="called_idemployee")
//	private Employee employee2;

	//bi-directional many-to-one association to Message
//	@OneToMany(mappedBy="conversation")
//	private Set<Message> messages;

    public Conversation() {
    }

	public int getIdconversation() {
		return this.idconversation;
	}

	public void setIdconversation(int idconversation) {
		this.idconversation = idconversation;
	}

	public Date getDayTimeBegin() {
		return this.dayTimeBegin;
	}

	public void setDayTimeBegin(Date dayTimeBegin) {
		this.dayTimeBegin = dayTimeBegin;
	}

	public Date getDayTimeEnd() {
		return this.dayTimeEnd;
	}

	public void setDayTimeEnd(Date dayTimeEnd) {
		this.dayTimeEnd = dayTimeEnd;
	}

	public int getCallerId() {
		return this.caller_idemployee;
	}

	public void setCallerId(int id) {
		this.caller_idemployee = id;
	}
	
	public int getCalledId() {
		return this.called_idemployee;
	}

	public void setCalledId(int id) {
		this.called_idemployee = id;
	}
	
//	public Set<Message> getMessages() {
//		return this.messages;
//	}
//
//	public void setMessages(Set<Message> messages) {
//		this.messages = messages;
//	}
	
}